<template>
  <div >

    <el-menu
         style="width: 200px; min-height: calc(100vh - 50px)"
        :default-active="path"
        router
    >
      <!-- <el-menu-item index="/home" v-if="this.role === '201810098030'">主页</el-menu-item> -->
      <el-menu-item index="/category" v-if="this.role == '1'" text-color="1e90ff">用户管理</el-menu-item>
      <el-menu-item index="/book" v-if="this.role == '2'||this.role=='1'" text-color="1e90ff">问卷管理</el-menu-item>
     
    </el-menu>
  </div>
</template>

<script>
// import request from "@/utils/request";

export default {
  name: "Aside",
  data() {
    return {
      user: {},
      role:sessionStorage.getItem('role'),
      path: this.$route.path,   // 设置默认高亮的菜单
     
    }
  },
  created() {
    // let userStr = sessionStorage.getItem("user") || "{}"
    // this.user = JSON.parse(userStr)

    // // 请求服务端，确认当前登录用户的 合法信息
    // request.get("/user/" + this.user.id).then(res => {
    //   if (res.code === '0') {
    //     this.user = res.data
    //   }
    // })
    console.log('全军'+this.role)

  }
}
</script>

<style scoped>
.el-menu-item.is-active {
      /* background-color: #3370ff !important; */
      color: #1e90ff;
     
    }

</style>
// 原文链接：https://blog.csdn.net/maidu_xbd/article/details/103282168
